<?php
namespace app\admin\controller;
use \think\Controller;
use \think\Session;
use \think\Db;
class Showpiccomment extends Common
{
	public function index($id){
		
		if(input('method')==0||input('method')==''){
			$result = Db::name("comments")->order('s_id')->where('pi_id',$id)->alias('a')->join('users b','a.u_id=b.u_id')->paginate(10);
		}/*else if(input('method')==1){
			$result = Db::name("showpiccomment")->order('showpiccommentid')->where('showpicid',$id)->alias('a')->join('user b','a.userid=b.userid')->where('b.username','like','%'.input('search').'%')->paginate(10);
		}else if(input('method')==2){
			$result = Db::name("showpiccomment")->order('showpiccommentid')->where('showpicid',$id)->alias('a')->join('user b','a.userid=b.userid')->where('a.commentcontent','like','%'.input('search').'%')->paginate(10);
		}*/
		$this->assign('commentlist',$result);
		$this->assign('showpicid',$id);
		return $this->fetch();
	}
	
	
	
}